package com.sbr.seb.wicket.page.delivery;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.PropertyListView;
import org.apache.wicket.spring.injection.annot.SpringBean;

import com.sbr.seb.entity.livraison.Delivery;
import com.sbr.seb.planning.dao.DeliveryDao;
import com.sbr.seb.wicket.panel.delivery.EditDeliveryPanel;

public class ListDeliveriesPage extends DeliveryBasePage {

    
	@SpringBean
	private DeliveryDao deliveryDao;
	
	public ListDeliveriesPage() {
    	super();

    	add(new PropertyListView<Delivery>("livraisonList", deliveryDao.findAll()) {

			private static final long serialVersionUID = 1L;

			@Override
			protected void populateItem(ListItem<Delivery> item) {
//				item.add(new Label("name", livraison.getName()));
				item.add(new Label("application.name"));
				item.add(new Label("commentaire"));
				item.add(new Label("installationDate"));
				item.add(new Label("environnement"));
				item.add(new Label("application.version"));
				
			}
    		
    	});
    	
//    	add(new BookmarkablePageLink("addLivraisonLink", AddAlter.class));
    	add(new EditDeliveryPanel("editDeliveryPanel"));
		
    }

	public void setDeliveryDao(DeliveryDao deliveryDao) {
		this.deliveryDao = deliveryDao;
	}
	
}
